#include <iostream>
#include <fstream>  //文件流库函数

using namespace std;

double currentOverlap_left[11];
double currentOverlap_right[11];
double left_ =0,right_ =0;



void filter(double left, double right)
{
    // cout << left << "\t" << right << endl;
  double sum_left =0,sum_right =0;
  currentOverlap_left[9] = left;
  currentOverlap_right[9] = right;
  sum_left =currentOverlap_left[0];
  sum_right =currentOverlap_right[0];

  for(int i=0;i<9;i++)
  {
    currentOverlap_left[i] = currentOverlap_left[i+1];
    sum_left = sum_left + currentOverlap_left[i];
    currentOverlap_right[i] = currentOverlap_right[i+1];
    sum_right = sum_right + currentOverlap_right[i];
  }
  currentOverlap_left[10] = sum_left / 10.0;
  currentOverlap_right[10] = sum_right / 10.0;

//   cout << currentOverlap_left[1] << "\t" << currentOverlap_right[1] << endl;
}

int main()
{
    ifstream infile;   //输出流
    ofstream outfile;   //输出流

   for(int i=0;i<9;i++)
    {
        currentOverlap_left[i] = 90;
        currentOverlap_right[i] = 90;
    }

    infile.open("../file2.txt");
    if(!infile.is_open())
        return -1;

    outfile.open("../output.txt");
    if(!outfile.is_open())
        return -1;
    
    while (!infile.eof())            // 若未到文件结束一直循环
    {
        infile >> left_ >> right_;
        // cout <<    left  << "  "<<  right <<endl;    

        filter(left_,right_);
        
        // outfile << left_ << "\t" << right_ << endl;
        outfile << currentOverlap_left[10] << "\t" << currentOverlap_right[10] << endl;

    }
    
    return 0;

}